package com.ruoyi.common.utils.wxPay;

import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;

public class MyConfig extends  WXPayConfig{

    private byte[] certData;
    String certPath = "apiclient_cert";
    File file = new File(certPath);

    public String getAppID() {
        return "";
    }

    public String getMchID() {
        return "";
    }

    public String getKey() {
        return "";   //生产Key
        //return Constants.VAL_WEIXIN_SANDBOX_APPKEY;  //沙盒Key
    }

    public InputStream getCertStream() throws Exception {
    	 InputStream certStream = new FileInputStream(file); 
    	this.certData = new byte[(int) file.length()];
    	    certStream.read(this.certData);
    	    certStream.close();
    	ByteArrayInputStream certBis = new ByteArrayInputStream(this.certData);
        return certBis;
    }

    public int getHttpConnectTimeoutMs() {
        return 8000;
    }

    public int getHttpReadTimeoutMs() {
        return 10000;
    }

//	@Override
//	IWXPayDomain getWXPayDomain() {
//		// TODO Auto-generated method stub
//		return null;
//	}
	protected IWXPayDomain getWXPayDomain() {
        return WXPayDomainSimpleImpl.instance();
    }
}